<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用药管理</title>
<link href="${ctx}/css/layout.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/js/validate/jquery.validate.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" charset="utf-8" src="${ctx}/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<script src="${ctx}/js/clinic/clinicrecord.js" type="text/javascript"></script>
<script src="${ctx}/js/clinic/medication.js" type="text/javascript"></script>
<script src="${ctx}/js/validate/jquery.validate.js" type="text/javascript"></script>
<script src="${ctx}/js/validate/messages_cn.js" type="text/javascript"></script>
<script type="text/javascript">
//用药记录模块验证
$(document).ready(function(){
	$("#clinicKindId").focus();
	//为inputForm注册validate函数
	$("#medicationInputForm").validate({
		rules: {
			term:{
				required: true
			},
			createDate:{
				required: true
			},
			endDate:{
				required: true
			},
			adminRoute:{
				required: true
			},
			singleDose:{
				required: true
			},
			takingDays:{
				required: true
			},
			doseUnit:{
				required: true
			},
			frequency:{
				required: true
			}
		}

	});
	
});

// 处理用药下拉列表值
function select(){
var value = $("#kindId").val();
  $("#parentId").html("");
	$.post("medication!returnKind.action",{kind:value},function(json){
		$.each(json,function(i){
			$("#parentId").append(
					"<option style='width:20px' value = '" + json[i]
					+ "'>" + json[i] + "</option>"   
			);	
		});
	});
}

</script>
</head>
<body bgcolor="#E5E5E5">
<form action="medication!save.action" method="post" id="medicationInputForm">
<div style="height: 180px">
<table>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>类型:</label><s:select id="clinicKindId" name ="prescription" list="clinicTypeList" listKey="id" listValue="term" cssStyle="width:30%" theme="simple"></s:select></td>
<td><label>药品类型:</label><s:select id="kindId" name="kind" list="mechineKindList" listKey="id" listValue="term" emptyOption="true" label="药品类型" cssStyle="width:30%" theme="simple" onchange="select();"></s:select></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>种类:</label><select id="parentId"  name="term" style="width:90px"></select></td>
</tr>

<tr>
<td><label>开药时间:</label><input type="text" name="createDate" id="createDateId" value="${createDate}" onclick="WdatePicker({el:'createDateId',dateFmt:'yyyy-MM-dd HH:mm:ss'})" size="10">

</td>
<td><label>结束时间:</label><input type="text" name="endDate" id="endDateId" value="${endDate}" onclick="WdatePicker({el:'endDateId',dateFmt:'yyyy-MM-dd HH:mm:ss'})"size="10">

</td>

<td>
<label>给药途径:</label><input type="text" name="adminRoute" id="adminRouteId" value="${adminRoute}" size="10">
</td>
</tr>

<tr>
<td><label>单次剂量:</label><input type="text" name="singleDose" id="singleDoseId" value="${singleDose}" size="10"></td>
<td><label>服药天数:</label><input type="text" name="takingDays" id="takingDaysId" value="${takingDays}" size="10"></td>
<td><label>剂量单位:</label><input type="text" name="doseUnit" id="doseUnitId" value="${doseUnit}" size="10"></td>
</tr>

<tr>
<td><label>服药频率:</label><input type="text" name="frequency" id="frequencyId" value="${frequency}" size="10"></td>
</tr>
</table>
<div align="right">&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit"
	value="添加" id="bc" />&nbsp;&nbsp;<s:reset
	value="清除" id="bc" theme="simple" cssStyle="width:100px"></s:reset></div>
<div id="">
<s:textarea name ="advice" id="text1" rows="3" cols="" value="" label="医嘱"></s:textarea>
</div>
</div>
</form>
</body>
</html>